#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int cmp_char(const void* p1, const void* p2)
{
    return *((char*)p1) - *((char*)p2);
}
int* masterMind(char* solution, char* guess, int* returnSize) {
    int* answer = (int*)malloc(sizeof(int) * 2);
    int i = 0; int a_true = 0; int b_true = 0;
    for (i = 0; i < 4; i++)
    {
        if (solution[i] == guess[i])
        {
            a_true++;
        }
    }
    qsort(solution, 4, sizeof(char), cmp_char);
    qsort(guess, 4, sizeof(char), cmp_char);
    if (strcmp(solution, guess) == 0)
    {
        b_true = 1;
    }
    answer[0] = a_true;
    answer[1] = b_true;
    *returnSize = 2;
    return answer;
}
int main()
{
    int returnsize=0;
    char arr1[5] = "RGRB";
    char arr2[5] = "BBBY";
    int*answer=masterMind(arr1,arr2,&returnsize);
    for (int i = 0; i < 2; i++)
    {
        printf("%d ", answer[i]);
    }
}